﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WS.EKA.ServiceInterface;
using WS.EKA.DataAccess;
using WS.EKA.Model;

namespace WS.EKA.ServiceImpl
{
    public class ShoppingCartService : IShoppingCart
    {
        public List<Model.ShoppingCart> GetByMember(string loginId)
        {
            return ShoppingCartContext.GetByConditions(t => t.MemLoginID == loginId, p => p.OrderBy(t => t.CreateTime));
        }


        public void Add(ShoppingCart product)
        {
            ShoppingCartContext.Add(product);
        }

        public void Update(ShoppingCart product)
        {
            ShoppingCartContext.Update(product);
        }

        public void Delete(string loginId, Guid productId)
        {
            ShoppingCartContext.Delete(loginId,productId);
        }


        
    }
}
